import { COUNTER_DECREMENT, COUNTER_INCREMENT } from '../constants'

export default function counter(state = 10, action) {
  switch (action.type) {
    case COUNTER_INCREMENT:
      return state + action.payload
    case COUNTER_DECREMENT:
      return state - action.payload
    default:
      return state
  }
}
